<!-- App.vue -->
 <!-- 获取子组件的值 -->
<template>
  <MySalaryInfo ref="salaryInfo" /><button @click="showRes">查看薪⽔信息</button>
</template>
<script setup lang="ts">
//引⼊⼦组件
import MySalaryInfo from './MySalaryInfo.vue';
import { ref } from 'vue';
//获取绑定对象
let salaryInfo = ref()
function showRes() {
  console.log(salaryInfo) //RefImpl ref对象
  console.log(salaryInfo.value) //Proxy ⼦组件的响应式数据
  console.log(salaryInfo.value.userName) //输⼊框的值
  console.log(salaryInfo.value.salary)
}
</script>
<style scoped></style>
